# -*- coding: utf-8 -*-
from odoo import models
from odoo.http import request


class IrHttp(models.AbstractModel):
    _inherit = 'ir.http'

    def session_info(self):
        """Add user layout preferences to session info"""
        result = super(IrHttp, self).session_info()
        
        # 确保有用户登录
        if request and request.env and request.env.user and not request.env.user._is_public():
            user = request.env.user
            result['menu_position'] = user.menu_position or 'top'
            result['enable_multi_tab'] = user.enable_multi_tab or False
        
        return result

